package com.mapgoo.implicitTest

/**
  *
  * @author eureka.wh
  * @since 2019-05-31 10:20
  */

// 隐式参数
object ParamDemo01 {

  def main(args: Array[String]): Unit = {

    // Param.print("hello")("welcome to China")
    import Context_Implicits._
    // 导入隐式转换后，允许传入或者不传带有隐式转换的参数
    Param.print("你好")
    Param.print("你好")("python")
  }
}

object Context_Implicits {
   implicit val default2d: String = "JAVA"
}


object Param {
  def print(context: String)(implicit language: String): Unit ={
    println(language + ":" + context)
  }
}
